package cn.zjweu.service;

import cn.zjweu.domain.Dish;
import cn.zjweu.domain.UserCart;

import java.util.List;

public interface CartService {

    /*购物车：通过userId和dishId查找购物车有没有改菜品*/
    UserCart findCartByUserAndDish(int userId, int dishId);

    /*购物车：编辑购物车菜品数量*/
    boolean editCountInCart(UserCart userCart);

    /*购物车：添加菜品到购物车*/
    boolean saveToCart(UserCart userCart);

    /*购物车：删除菜品*/
    boolean clearCartByUserIdOrDishId(int userId, int dishId);

    /*购物车：根据用户编号查找购物车信息*/
    List<Dish> findCartListByUserId(int userId);

    /*购物车：清空购物车*/
    boolean clearCartByUserId(int userId);
}
